package com.huan.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.TopicExchange;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.amqp.core.Queue;

@Configuration
public class RabbitMQConfig {

  @Bean
  public Queue queue() {
  return new Queue("my.queue");
  }
  @Bean
  public Queue queue02() {
    return new Queue("commentExchange");
  }

  @Bean
  public TopicExchange exchange() {
  return new TopicExchange("my.exchange");
  }
  @Bean
  public TopicExchange exchange02() {
    return new TopicExchange("commentExchange");
  }

  @Bean
  public Binding binding(Queue queue, TopicExchange exchange) {
  return BindingBuilder.bind(queue).to(exchange).with("#");
  }
  @Bean
  public Binding binding02(Queue queue02, TopicExchange exchange02) {
    return BindingBuilder.bind(queue02).to(exchange02).with("#");
  }

}
